package com.bytezero.login_test.home;

import androidx.recyclerview.widget.GridLayoutManager;

import com.bytezero.login_test.bean.Goods;

import java.util.List;

/**
 * @author Bytezero_zhenglei!
 * @package com.bytezero.login_test.home
 * @fileName null
 * @data 2022/1/27 15:10
 * @description
 * @TODO
 * @email 420498246@qq.com
 */
public class HomeSpanSizeLookup extends GridLayoutManager.SpanSizeLookup {

    private final List<Goods> data;

    public HomeSpanSizeLookup(List<Goods> data){
        this.data = data;
    }
    @Override
    public int getSpanSize(int position) {
        return data.get(position).getSpanSize();
    }

    public void setGoods(List<Goods> data) {
        this.data.clear();
        this.data.addAll(data);

    }
}
